package com.example.check.realm.factory;

import java.util.LinkedHashMap;

/**
 * Created by Tony Yao on 2017/7/25.
 */
public class FilterChainDefinitionMapBuilder {
//    添加权限过滤器
    public LinkedHashMap<String,String> buildFilterChainDefinitionMap(){
        LinkedHashMap<String,String> map = new LinkedHashMap<>();

        //让静态资源不受拦截

        map.put("/assets/**", "anon");
        map.put("/css/**", "anon");
        map.put("/font/**", "anon");
        map.put("/img/**", "anon");
        map.put("/js/**", "anon");
        map.put("/**.js", "anon");
        map.put("/**.css", "anon");
//        //登录首页和注册首页能匿名访问
        map.put("/login.jsp", "anon");
        map.put("/logout.do","logout");
        map.put("/enroll.do", "anon");
        map.put("/updatepassword.do","authc");

        map.put("/search*","authc,perms[2]");
        map.put("/*User*","authc,perms[4]");
        map.put("/*Role*","authc,perms[6]");
        map.put("/*Permission*","authc,perms[7]");

        return map;
    }

}
